package 设计模式.singleton.test4;

public class meiju {
    public static void main(String[] args) {
        Singleton instance = Singleton.INSTANCE;
        Singleton instance2 = Singleton.INSTANCE;
        System.out.println(instance==instance2);
        System.out.println(instance.hashCode());
        System.out.println(instance2.hashCode());
        instance.sayOK();
    }
}

enum Singleton{
    INSTANCE;
    public void sayOK(){
        System.out.println("ok~");
    }
}
